package com.du.utils;

import org.apache.commons.beanutils.BeanUtils;

import java.lang.reflect.InvocationTargetException;
import java.util.Map;

/**
 * @author : DuJiabao
 * @Date : 2021/1/31 22:51
 * @Project : bookstore
 * @File : null.java
 * @Desc :
 */
public class WebUtils {
    public static <T> T copyParamToBean(Map<String, String[]> params, T bean) {
        try {
            BeanUtils.populate(bean, params);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }
}
